home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / MATH / FSULTRA1.ZIP / ULTRX_C.ASM < prev    next >
Assembly Source File  |  1992-06-18  |  3KB  |  141 lines

  1. comment ! 
  2. FSU - ULTRA    The greatest random number generator that ever was
  3.         or ever will be.  Way beyond Super-Duper.
  4.         (Just kidding, but we think its a good one.)
  5.  
  6. Authors:    Arif Zaman (arif@stat.fsu.edu) and
  7.         George Marsaglia (geo@stat.fsu.edu).
  8.  
  9. Date:        27 May 1992
  10.  
  11. Version:    1.05
  12.  
  13. Copyright:    To obtain permission to incorporate this program into
  14.         any commercial product, please contact the authors at
  15.         the e-mail address given above or at
  16.  
  17.         Department of Statistics and
  18.         Supercomputer Computations Research Institute
  19.         Florida State University
  20.         Tallahassee, FL 32306.
  21.  
  22. See Also:    README        for a brief description
  23.         ULTRA.DOC    for a detailed description
  24.  
  25. -----------------------------------------------------------------------
  26. ;
  27. ;  File: ULTRX_C.ASM   (80386 Turbo C calling conventions)
  28. ;
  29.     ifdef    __TINY__
  30.         m equ tiny
  31.     elseifdef __SMALL__
  32.         m equ small
  33.     elseifdef __MEDIUM__
  34.         m equ medium
  35.     elseifdef __COMPACT__
  36.         m equ compact
  37.     elseifdef __LARGE__
  38.         m equ large
  39.     elseifdef __HUGE__
  40.         m equ huge
  41.     endif
  42.     DOSSEG
  43.     .MODEL m,c
  44.  
  45. ;===== GLOBAL FUNCTIONS, SUBROUTINES and VARIABLES =================
  46. ;
  47.     public  i31bit, i15bit, i7bit,  i1bit,  uni,    duni
  48.     public  i32bit, i16bit, i8bit,  rinit,  vni,    dvni
  49.     public    swbstate, swbsize
  50.  
  51. ;===== MACRO DEFINITIONS ===========================================
  52. ;
  53. ; RinitProcStart should take two 32-bit arguments conx and shrx
  54. ;   and place them in eax and ebx.
  55. ;   es and ds should both point to the data segment.
  56. ;   conx must be odd (so we or with 1 just to make sure).
  57. ; FillProc
  58. ;   DS is already the data segment. ES should also be made the same.
  59.  
  60. EnterProcedure   macro saveregs
  61.     if @DataSize eq 2
  62.       mov  dx,@DATA
  63.       push ds
  64.       mov  ds,dx
  65.     endif
  66.     irp    regs,saveregs
  67.     ifidn <regs>,<di>
  68.         push   di
  69.     elseifidn <regs>,<si>
  70.         push   si
  71.     endif
  72.     endm
  73. endm
  74.  
  75. ExitProcedure    macro saveregs
  76.     irp regs,saveregs
  77.     ifidn <regs>,<si>
  78.         pop   si
  79.     elseifidn <regs>,<di>
  80.         pop   di
  81.     endif
  82.     endm
  83.     if @DataSize eq 2
  84.       pop ds
  85.     endif
  86.     ret
  87. endm
  88.  
  89. Enter2arg   macro
  90.   arg conx:dword, shrx:dword
  91.   EnterProcedure <si,di>
  92.     mov ax,ds
  93.     mov es,ax
  94.     mov eax,conx
  95.     shl eax,1
  96.     or  al,1
  97.     mov ebx,shrx
  98. endm
  99.  
  100. Exit2arg     macro
  101.     ExitProcedure <di,si>
  102. endm
  103.  
  104. EnterFill    macro
  105.     mov    ax,ds
  106.     mov    es,ax
  107.     push    di
  108.     push    si
  109. endm
  110.  
  111. ExitFill    macro
  112.     pop    si
  113.     pop    di
  114.     ret
  115. endm
  116.  
  117. DwordFn macro
  118. endm
  119.  
  120. WordFn  macro
  121. endm
  122.  
  123. ByteFn  macro
  124. endm
  125.  
  126. RealFn  macro
  127. endm
  128.  
  129. DoubleFn macro
  130. endm
  131.  
  132. .DATA
  133.   INCLUDE ULTRADAT.INC
  134.  
  135. .STACK 10h
  136.  
  137. .CODE
  138.   INCLUDE ULTRxCOD.INC
  139. END
  140.